# coding=utf-8
"""
    @Author：SimpleTree
    @date：2025/4/29 6:38
    @desc: 
"""


class ReloadConfigBase:
    @classmethod
    def get_all(cls):
        # 用于获取类中所有非方法、非私有属性的配置项，并以字典形式返回
        configs = {}
        for k, v in cls.__dict__.items():
            if not callable(getattr(cls, k)) and not k.startswith('__') and not k.startswith("_"):
                configs[k] = v
        return configs

    @classmethod
    def get(cls, config_name):
        return getattr(cls, config_name) if hasattr(cls, config_name) else None
